<!DOCTYPE html>
<html>
	<head>
		<title>用户注册</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<link rel="stylesheet" type="text/css" href="style/style.css" />
		
		<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
		<script src="js/angular.min.1.4.6.js"></script> 
		<script type="text/javascript" src="js/index.js"></script>
		<script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
		<script type="text/javascript" src="layer/layer.js"></script>
	</head>

	<body  ng-app="indexApp">
		<div class="conter ma">
			<div class="header" ng-include="'header.html'" ></div>
			<div class="nybanner">
				<img src="images/nybanner.jpg" width="997" height="198" /></div>
			<div class="side">
				<div class="stitle">
					用户注册<span> </span></div>
				

				<div class="side_c">
					<p>
						<a href="mainBusiness.htm"><img src="images/sc1.jpg" width="226" height="73" /></a>
					</p>
					<p>
						<a href="auth.htm"><img src="images/sc2.jpg" width="226" height="74" /></a>
					</p>
					<p>
						<a href="train.htm"><img src="images/sc3.jpg" width="226" height="78" /></a>
					</p>
				</div>
			</div>
			<div class="mian">
				<div class="mtitle">
					用户注册<span>您的当前位置：<a href="home.htm" >主页</a> > <a href="#" >用户注册</a> > 
                </span>
				</div>
				<div class="miancont">
					
					<form action="javascript:doSearch();" method="post" class="login-form">
					<div style=" padding:10px; width:350px;">
						<div class="form-group">
							<label>用户名</label>
							<input type="text" name="userId" id="userId" class="form-control" placeholder="用户名">
						</div>
						<div class="form-group">
							<label>密码</label>
							<input type="password" name="passWord" id="passWord" class="form-control" placeholder="密码">
						</div>
						<div class="form-group">
							<label>密码确认</label>
							<input type="password" name="passWord2" id="passWord2" class="form-control" placeholder="再次输入密码">
						</div>
						<div class="form-group">
							<label>企业名称</label>
							<input type="text" name="qymc" id="qymc" class="form-control" placeholder="企业名称">
						</div>
						<div class="form-group">
							<label>联系方式</label>
							<input type="text" name="lxfs" id="lxfs" class="form-control" placeholder="联系方式">
						</div>
						<div class="form-group"  style=" position: relative; ">
							<label>验证码</label>
							<input type="text" class="form-control" id="yzmcode" style="width:calc(100% - 110px) !important;"/>
							<span style=" position: absolute; top: 30px; right:0px;"><img id="imgCode" title="换一个" onclick="changeVerifyCode();" src="validator/validator.do" style="height:22px;width:63px;border-width:0px;cursor: pointer;" /></span>
						</div>
						
						
						<div><button class=" btn btn-primary" data-ajax="post" type="submit" data-callback="success">注 册</button></div>
					</div>
					</form>
					<script type="text/javascript">
							function changeVerifyCode(){
								$("#imgCode").attr("src","validator/validator.do?"+Math.random());
							}
							function doSearch() {
								var userId = $('#userId').val();
								var userName = $('#userId').val();
								var userPasswd = $('#passWord').val();
								var userPasswd2 = $('#passWord2').val();
								var txtval = jQuery('#yzmcode').val();
								var companyName = jQuery('#qymc').val();
								var phoneNum = jQuery('#lxfs').val();
								
								if(userId == "" || userPasswd == "" ) {
									layer.msg('请输入用户名和密码！');
								} else if(userPasswd2 == "") {
									layer.msg('请输入密码再次确认！');
								} else if(userPasswd2 != userPasswd) {
									layer.msg('两次输入的密码不一致，请重新输入！');
								} else if(txtval == "") {
									layer.msg("请输入验证码!");
								} else {
									$.ajax({
										url : "/register.do",
										datatype : "json",
										data : {
											userId : userId,
											userName : userName,
											userPasswd : userPasswd,
											isAdmin : 0,
											code : txtval,
											companyName : companyName,
											phoneNum : phoneNum
											
										},
										type : 'POST',
										async : false,
										success : function(data) {
											if (data.status != 10001) {//
												layer.msg(data.msg);  
											} else {
												layer.msg(data.msg, {
													  icon: 1,
													  time: 2000 
													}, function(){
														window.location.replace("/")
													});  
											}
										}
									});
								}
								
							}
					</script>
				</div>
			</div>
			<div class="clear">
			</div>

			<div class="footer"ng-include="'footer.html'" ></div>

		</div>
		<script type="text/javascript">
		angular.module('indexApp', []).controller('indexContr', function($scope) {
			$(".menu ul li.dq").each(function() {
				$(this).hover(function() {

					$(this).find(".submenu").stop(false, true).slideDown();
				}, function() {

					$(this).find(".submenu").stop(false, true).slideUp();

				});
			});
			function menuon(id) {
				$(".menu ul li.dq a").each(function() {
					$(this).removeClass("on");
				});
				$(".menu ul li.dq").eq(id - 1).children("a").addClass("on");
			}
			$(".menu ul li .submenu .submenubg a:last-child").css("border-bottom", "none");
			menuon(7);
		});
		</script>

	</body>


</html>
